from machine import Pin
from machine import Timer

led_blue = Pin(18, Pin.OUT)

led_state = False

def timer0_irq(timer0):
    global led_state
    
    led_state = not led_state
    led_blue.value(led_state)

#程序的开始
if __name__ == "__main__":
    led_blue.value(0)
    
    timer0 = Timer(0)
    timer0.init(mode=Timer.PERIODIC, period=500, callback=timer0_irq)
    
    while True:
        pass